
--修改状态sql
update Course set status=1 where endDate < now()
update Course set status=0 where startDate < now() and status=2
update Children set status=1
update  Children set  status= 0 where id in  (select cid from Course where status in (0,2))



BEGIN;
INSERT INTO `rel_role_menu` (id, menuId, roleId) VALUES ('7fe81ea7835041fd9a6f6b7d83ec84a8', '4028478d5da2317c015da2318ad20001', '4028478d5da239d4015da239e20d0000'),
('7fe81ea7835041fd9a6f6b7d83ec84a9', '4028478d5da2317c015da2318abd0000', '4028478d5da239d4015da239e20d0000'),
('7fe81ea7835041fd9a6f6b7d83ec84b0', '4028478d5da2317c015da2318ad20002', '4028478d5da239d4015da239e20d0000'),
('7fe81ea7835041fd9a6f6b7d83ec84b1', '4028478d5da2317c015da2318ad20003', '4028478d5da239d4015da239e20d0000'),
('7fe81ea7835041fd9a6f6b7d83ec84b2', '4028478d5da2317c015da2318ad30004', '4028478d5da239d4015da239e20d0000'),
('7fe81ea7835041fd9a6f6b7d83ec84b3', '4028478d5da2317c015da2318ad30005', '4028478d5da239d4015da239e20d0000'),
('7fe81ea7835041fd9a6f6b7d83ec84b4', '4028478d5da2317c015da2318ad30006', '4028478d5da239d4015da239e20d0000'),
('7fe81ea7835041fd9a6f6b7d83ec84b5', '4028478d5da2317c015da2318ad30007', '4028478d5da239d4015da239e20d0000'),
('7fe81ea7835041fd9a6f6b7d83ec84b6', '4028478d5da2317c015da2318ad30009', '4028478d5da239d4015da239e20d0000'),
('7fe81ea7835041fd9a6f6b7d83ec84b7', '4028478d5da2317c015da2318ad30008', '4028478d5da239d4015da239e20d0000'),
('7fe81ea7835041fd9a6f6b7d83ec84c0', '4028478d5da2317c015da2318ad20001', '4028478d5da239d4015da239e2230001'),
('7fe81ea7835041fd9a6f6b7d83ec84c1', '4028478d5da2317c015da2318abd0000', '4028478d5da239d4015da239e2230001'),
('7fe81ea7835041fd9a6f6b7d83ec84c2', '4028478d5da2317c015da2318ad20002', '4028478d5da239d4015da239e2230001'),
('7fe81ea7835041fd9a6f6b7d83ec84c3', '4028478d5da2317c015da2318ad20003', '4028478d5da239d4015da239e2230001'),
('7fe81ea7835041fd9a6f6b7d83ec84c4', '4028478d5da2317c015da2318ad30004', '4028478d5da239d4015da239e2230001'),
('7fe81ea7835041fd9a6f6b7d83ec84c5', '4028478d5da2317c015da2318ad30006', '4028478d5da239d4015da239e2230001'),
('7fe81ea7835041fd9a6f6b7d83ec84c6', '4028478d5da2317c015da2318ad30007', '4028478d5da239d4015da239e2230001'),
('7fe81ea7835041fd9a6f6b7d83ec84c7', '4028478d5da2317c015da2318ad30008', '4028478d5da239d4015da239e2230001');
COMMIT;
-- menu
BEGIN;
INSERT INTO `menu` (id, deleted, icon, lvl, `name` ,pid, url, idx) VALUES
('4028478d5da2317c015da2318abd0000', b'0', 'fa fa-dashboard', '0', '首页', '', '/', '1'),
('4028478d5da2317c015da2318ad20001', b'0', 'fa fa-envelope', '0', '入学管理', '', '/baby', '2'),
('4028478d5da2317c015da2318ad20002', b'0', null, '1', '课程列表', '4028478d5da2317c015da2318ad20001', '/baby/list', '3'),
('4028478d5da2317c015da2318ad20003', b'0', null, '1', '添加课程', '4028478d5da2317c015da2318ad20001', '/baby/add', '4'),
('4028478d5da2317c015da2318ad30004', b'0', 'fa fa-table', '0', '托班管理', '', '/classes', '5'),
('4028478d5da2317c015da2318ad30005', b'0', null, '1', '班级列表', '4028478d5da2317c015da2318ad30004', '/classes/list', '6'),
('4028478d5da2317c015da2318ad30006', b'0', null, '1', '添加班级', '4028478d5da2317c015da2318ad30004', '/classes/add', '7'),
('4028478d5da2317c015da2318ad30007', b'0', 'fa fa-video-camera', '0', '摄像头管理', '', '/camera', '8'),
('4028478d5da2317c015da2318ad30008', b'0', null, '1', '本园区摄像头', '4028478d5da2317c015da2318ad30007', '/camera/local', '9'),
('4028478d5da2317c015da2318ad30009', b'0', null, '1', '全园区摄像头', '4028478d5da2317c015da2318ad30007', '/camera/all', '10');
COMMIT;
-- role

BEGIN;
INSERT INTO `teach_role` (id, comment, deleted, roleCode, roleName) VALUES
 ('4028478d5da239d4015da239e20d0000', '', b'0', 'ROLE_ADMIN', '管理员'),
 ('4028478d5da239d4015da239e2230001', '', b'0', 'ROLE_TEACHER', '园区教师'),
 ('4028478d5da239d4015da239e2230002', '', b'0', 'ROLE_GARDEN_LEADER', '园区园长');
COMMIT;

-- system Setting
BEGIN;
INSERT INTO `setting` (id, `name`, `value`, `remark`) VALUES
('62219c397d014bbc9d6817ea2ca27201', 'T_live_room_prefix', 'http://rtmp.mc.mattbaby.com/', '前端播放地址拼接前缀'),
('62219c397d014bbc9d6817ea2ca27202', 'T_ding_ding_app_id', 'dingoa8vkudpsn7n9spnse', '钉钉appid'),
('62219c397d014bbc9d6817ea2ca27203', 'T_ding_ding_call_back_url', 'http://t.dev.mattbaby.com/auth', '钉钉回调地址'),
('62219c397d014bbc9d6817ea2ca27205', 'T_APK_APP_VERSION', '1.0.0', '教务安卓APP版本'),
('62219c397d014bbc9d6817ea2ca27206', 'T_IOS_PAD_VERSION', '1.0.0', '教务苹果PAD版本'),
('62219c397d014bbc9d6817ea2ca27208', 'T_IOS_APP_VERSION', '1.0.0', '教务苹果APP版本'),
('62219c397d014bbc9d6817ea2ca27209', 'T_APK_PAD_VERSION', '1.0.0', '教务安卓PAD版本');
COMMIT;


-- area 添加研究院园区
-- 执行LiveRoomOperator processLiveRoom 的sql处理方法，
-- 修改liveroom,添加字段 type 类型，萤石云id;流畅地址；高清地址；预览图; deleted；

-- 处理   把duration 字段改为double原有数据修改为  月 或 次

ALTER TABLE `staff` ADD COLUMN `praise`  int NOT NULL DEFAULT 0 COMMENT '赞' AFTER `username`;

